package JFrame;

import java.awt.BorderLayout;
import java.awt.EventQueue;

import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.border.EmptyBorder;
import javax.swing.GroupLayout;
import javax.swing.GroupLayout.Alignment;
import javax.swing.JButton;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;

import javax.swing.LayoutStyle.ComponentPlacement;
import javax.swing.JLabel;
import javax.swing.JTextField;
import javax.swing.JPasswordField;
import java.awt.Font;
import java.awt.Color;
import java.awt.Toolkit;
import com.jgoodies.forms.layout.FormLayout;
import com.jgoodies.forms.layout.ColumnSpec;
import com.jgoodies.forms.factories.FormFactory;
import com.jgoodies.forms.layout.RowSpec;
import net.miginfocom.swing.MigLayout;

public class Login extends JFrame {

	private JPanel contentPane;
	private JTextField textField;
	private JPasswordField passwordField;

	/**
	 * Launch the application.
	 */
	public static void main(String[] args) {
		EventQueue.invokeLater(new Runnable() {
			public void run() {
				try {
					Login frame = new Login();
					frame.setVisible(true);
				} catch (Exception e) {
					e.printStackTrace();
				}
			}
		});
	}

	/**
	 * Create the frame.
	 */
	public Login() {
		setIconImage(Toolkit.getDefaultToolkit().getImage(Login.class.getResource("/images/logo.png")));
		setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		setResizable(false);
		setBounds(100, 100, 450, 300);
		contentPane = new PanelImageTest();
		contentPane.setBackground(new Color(224, 255, 255));
		contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
		setContentPane(contentPane);
		
		JButton loginButton = new JButton("\u767B\u9646");
		loginButton.setBounds(189, 216, 82, 27);
		loginButton.setBackground(new Color(255, 250, 205));
		loginButton.setFont(new Font("����", Font.PLAIN, 16));
		loginButton.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				
				mainField mainField1 = new mainField();
				mainField1.main(null);
				dispose();

			}
		});
		
		JButton button = new JButton("\u6CE8\u518C");
		button.setBounds(320, 216, 82, 27);
		button.setBackground(new Color(255, 250, 205));
		button.setFont(new Font("����", Font.PLAIN, 16));
		
		JLabel label = new JLabel("\u8D26 \u53F7\uFF1A");
		label.setBounds(189, 138, 49, 16);
		label.setFont(new Font("����", Font.PLAIN, 14));
		
		JLabel label_1 = new JLabel("\u5BC6 \u7801\uFF1A");
		label_1.setBounds(189, 173, 49, 16);
		label_1.setFont(new Font("����", Font.PLAIN, 14));
		
		textField = new JTextField();
		textField.setBounds(275, 136, 127, 21);
		textField.setColumns(10);
		
		passwordField = new JPasswordField();
		passwordField.setBounds(275, 175, 127, 21);
		
		JLabel label_2 = new JLabel("\u671F\u8D27\u4EA4\u6613\u7CFB\u7EDF");
		label_2.setBounds(38, 131, 158, 58);
		label_2.setBackground(Color.WHITE);
		label_2.setFont(new Font("���Ŀ���", Font.PLAIN, 20));
		contentPane.setLayout(null);
		
		JLabel lblNewLabel = new JLabel("\u9ED1\u6843\u8F6F\u4EF6");
		lblNewLabel.setBounds(38, 30, 259, 91);
		lblNewLabel.setFont(new Font("��������", Font.PLAIN, 30));
		contentPane.add(lblNewLabel);
		contentPane.add(label_2);
		contentPane.add(label);
		contentPane.add(label_1);
		contentPane.add(textField);
		contentPane.add(passwordField);
		contentPane.add(loginButton);
		contentPane.add(button);
	}
}
